import Vue from 'vue'
import Router from 'vue-router'
import Home from '../pages/Home'
import All from '../pages/home/All'
Vue.use(Router)

export default new Router(
  {
    linkActiveClass: "is-active",
  routes: [{
      path: '/home',
      component: Home,
      children:[
        {
          path:'all',
          component: All,
        },
        {
           path:'Essence',
           component: resolve => {
            require(['../pages/home/Essence'], resolve)
      }
        },  
        {
           path:'share',
           component: resolve => {
            require(['../pages/home/Share'], resolve)
           }
        },
        {
           path:'qaa',
           component: resolve => {
            require(['../pages/home/Qaa'], resolve)
           }
        },
        {
           path:'recruit',
           component: resolve => {
            require(['../pages/home/Recruit'], resolve)
           }
        }
      ]
    },
    {
      path: '/Publish',
      component: resolve => {
        require(['../pages/Publish'], resolve)
      }
    },
    {
      path:'/News',
      component:resolve => {
        require(['../pages/News'],resolve)
      }
    },
    {
      path:'/User',
      component:resolve => {
        require(['../pages/User'],resolve)
      }
    },
    {
      path:'/list/:id',
      component:resolve => {
        require(['../pages/home/List'],resolve)
      }
    },
    {
      path:"*",
      redirect:'home/All'
    }
  ]
})
